<template>
	<view class="ceng oh">
		<!-- <view class="bjt">
			<image src="/static/img/common/jiuku_bj.png"></image>
		</view> -->
		<view class="yyy">
			<view class="yyy1 tc">
				酒库
			</view>
			<view class="yyy2 tc">
				<view class="yyy21">我的资产</view>
				<view class="yyy22 oh">
					<view class="yyy221 le">
						<view class="yyy2211" v-if="myAsset">{{myAsset.totalAsset || 0}}</view>
						<view class="yyy2212">资产(元)</view>
					</view>
					<view class="yyy221 le">
						<view class="yyy2211" v-if="myAsset">{{myAsset.totalWineCount || 0}}</view>
						<view class="yyy2212">藏酒(坛)</view>
					</view>
				</view>
			</view>
			<view class="yyy2 tc yyy3">
				<view class="yyy21">我的藏酒</view>
				<view class="yyy31 oh">
					<view class="yyy311">
						<image src="/static/img/common/jiuku_tu1.png"></image>
					</view>
					<view class="yyy312 tc">暂无藏酒，请先封坛～</view>
					<view class="yyy313 tc">
						去封坛
					</view>
				</view>
			</view>
			<view class="yyy4 oh">

			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				showCategoryIndex: 0,
				headerPosition: 'fixed',
				categoryList: [],
				myWineStorage:null, //我的藏酒
				myAsset:null, //我的资产
			};
		},
		onPageScroll(e) {
			//兼容iOS端下拉时顶部漂移
			if (e.scrollTop >= 0) {
				this.headerPosition = 'fixed';
			} else {
				this.headerPosition = 'absolute';
			}
		},
		onLoad() {
			this.$queue.showLoading('加载中...');
			// 我的藏酒
			this.$Request.post('/api/front/user/user/myWineStorage').then(res => {
				if (res.errCode === 200) {
					console.log(res, '我的藏酒1');
				}
				uni.hideLoading();
			});
			//我的资产
			this.$Request.post('/api/front/user/user/myAsset').then(res => {
				if (res.errCode === 200) {
					this.myAsset = res.data
				}
				uni.hideLoading();
			});
		},
		methods: {
			/**
			 * 统一跳转接口,拦截未登录路由
			 * navigator标签现在默认没有转场动画，所以用view
			 */
			navToLogin(url) {
				let token = this.$queue.getData('token');
				let mobile = this.$queue.getData('mobile');
				let userId = this.$queue.getData('userId');
				if (token) {
					// #ifdef MP-WEIXIN
					if (uni.getStorageSync('sendindexMsg')) {
						uni.requestSubscribeMessage({
							tmplIds: this.arr,
							success(re) {
								// console.log(re,'**********')
								var datas = JSON.stringify(re);
								if (datas.indexOf("accept") != -1) {
									console.log(re)
								}
							},
							fail: (res) => {
								console.log(res)
							}
						})
					}
					// #endif
					this.$Request.getT('/user/' + userId).then(res => {
						if (res.status === 0 && res.data.phone) {
							uni.navigateTo({
								url
							});
						} else {
							uni.navigateTo({
								url: '/pages/public/mobile'
							});
						}
					});
				} else {
					this.goLoginInfo();
				}
			},
			//统一登录跳转
			goLoginInfo() {
				uni.navigateTo({
					url: '/pages/member/register'
				});
			},
			//分类切换显示
			showCategory(index) {
				this.showCategoryIndex = index;
			},
			toCategory(id, name) {
				uni.navigateTo({
					url: '/pages/categray/search?cid=' + id + '&name=' + name
				});
			},
			goSearch() {
				uni.navigateTo({
					url: '/package/pages/homeSearch/index'
				});
			},
		}
	};
</script>
<style lang="scss">
	.content-div {
		width: 100%;
		display: flex;
		justify-content: space-around;
		z-index: 999;
		height: 104upx;
		/* #ifdef APP-PLUS */
		height: 110upx;
		// margin-top: -20rpx;
		// padding-top: 70rpx;
		/* #endif */
	}

	.ceng {
		height: 100vh;
		width: 100vw;
		background: #2C66A2;

		.bjt {
			image {
				height: 100vh;
				width: 100vw;
			}
		}

		.yyy {
			position: relative;
			// top: -100vh;
			margin-top: 114rpx;

			.yyy1 {

				font-family: Source Han Sans, Source Han Sans;
				font-weight: 700;
				font-size: 32rpx;
				color: #FFFFFF;
				line-height: 32rpx;

			}

			.yyy2 {
				margin: 0 32rpx;
				margin-top: 86rpx;
				height: 330rpx;
				background: #fff;

				.yyy21 {


					font-family: Source Han Serif CN, Source Han Serif CN;
					font-weight: 600;
					font-size: 32rpx;
					color: #FFE294;


				}

				.yyy22 {
					margin: 0 5%;
					margin-top: 112rpx;

					.yyy221 {
						width: 50%;

						.yyy2211 {
							font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
							font-weight: 700;
							font-size: 54rpx;
							color: #142E7B;
							margin-bottom: 8rpx;
						}

						.yyy2212 {
							font-family: Source Han Sans, Source Han Sans;
							font-weight: 500;
							font-size: 24rpx;
							color: #1B1B1B;

						}
					}
				}
			}

			.yyy3 {
				height: 690rpx;
				margin-top: 60rpx;

				.yyy31 {
					.yyy311 {
						margin-top: 104rpx;
						margin-bottom: 20rpx;

						image {
							width: 204rpx;
							height: 204rpx;
						}
					}

					.yyy312 {
						margin-top: 20rpx;
						margin-bottom: 74rpx;


						font-family: Source Han Sans, Source Han Sans;
						font-weight: 400;
						font-size: 24rpx;
						color: #838BA5;
						line-height: 32rpx;
					}

					.yyy313 {
						width: 42%;
						height: 94rpx;
						line-height: 94rpx;
						background: #2c4abb;
						font-family: Source Han Serif CN, Source Han Serif CN;
						font-weight: 600;
						font-size: 28rpx;
						color: #FFE294;
						margin: 0 29%;
					}
				}
			}

		}
	}

	.icon-headerI {
		font-size: 24rpx;
		color: #999999;
	}

	.icon_header {
		width: 590rpx;
		display: flex;
		height: 72upx;
		align-items: center;
		line-height: 40upx;
		padding: 10upx 20upx;
		background-color: #F0F1F5;
		border-radius: 10upx;
		margin-top: 14upx;
		margin-left: 18rpx;
	}

	.header-imgsuo {
		width: 37rpx;
		height: 35rpx;
		margin-right: 10upx;
		align-items: center;
		display: block;
	}

	.status {
		width: 100%;
		height: 0;
		position: fixed;
		z-index: 10;
		background-color: #fff;
		top: 0;
		/*  #ifdef  APP-PLUS  */
		height: var(--status-bar-height); //覆盖样式
		/*  #endif  */
	}

	.category-list {
		width: 100%;
		// margin-top: 20upx;
		display: flex;
		/* #ifndef H5 */
		position: fixed;
		top: 120rpx;
		/* #endif */
		/* #ifdef H5 */
		position: fixed;
		top: 200rpx;
		/* #endif */

		.left,
		.right {
			top: 88upx;
			bottom: 0upx;
		}

		.left {
			position: fixed;
			width: 24%;
			/* #ifndef H5 */
			top: 105rpx;
			/* #endif */
			/* #ifdef H5 */
			top: 180upx;
			/* #endif */
			left: 0upx;
			background-color: #FFFFFF;

			.row {
				width: 100%;
				height: 90upx;
				display: flex;
				align-items: center;

				.text {
					width: 100%;
					position: relative;
					font-size: 28upx;
					display: flex;
					justify-content: center;
					color: #333333;
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;

					.block {
						position: absolute;
						width: 0upx;
						left: 0;
					}
				}

				&.on {
					height: 100upx;
					// background-color: #F2F2F2;

					.text {
						font-size: 28rpx;
						font-weight: 600;
						color: #ffffff;
						background: #FF3333;
						border-radius: 45rpx;
						padding: 15rpx 0rpx;
						margin: 0rpx 10rpx;

						.block {
							width: 8upx;
							height: 100upx;
							top: -72%;
						}
					}
				}
			}
		}

		.right {
			margin-left: 27%;
			width: 70%;
			left: 24%;
			background-color: #FFFFFF;
			border-radius: 30upx;

			.category {
				width: 94%;
				padding: 20upx 3%;

				.banner {
					width: 100%;
					height: 24.262vw;
					border-radius: 10upx;
					overflow: hidden;
					box-shadow: 0upx 5upx 20upx rgba(0, 0, 0, 0.3);

					image {
						width: 100%;
						height: 24.262vw;
					}
				}

				.list {
					margin-top: 40upx;
					width: 100%;
					display: flex;
					flex-wrap: wrap;

					.box {
						width: calc(61.44vw / 3);
						margin-bottom: 30upx;
						display: flex;
						justify-content: center;
						align-items: center;
						flex-wrap: wrap;

						image {
							width: 60%;
							border-radius: 10upx;
							height: calc(71.44vw / 3 * 0.6);
						}

						.text {
							margin-top: 5upx;
							width: 100%;
							text-align: center;
							font-size: 26upx;
							text-overflow: ellipsis;
							overflow: hidden;
							white-space: nowrap;
						}
					}
				}
			}
		}
	}
</style>